package com.hudson.pattern.flyweight;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class FlyweightFactory {

    private static final Map<Integer, Circle> FLYWEIGHT_MAP = new ConcurrentHashMap<>();

    public static Circle get(int type) {
        return FLYWEIGHT_MAP.computeIfAbsent(type, Circle::new);
    }
}
